package com.gao.controller;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author gao
 * @time 2020/05/29 21:22:59
 */
@Controller
@RequestMapping("view")
public class ViewController {

    @RequiresPermissions("product:find")
    @GetMapping("product_list")
    public String toProductUI() {
        return "product/product_list";
    }

    @RequiresPermissions("order:find")
    @GetMapping("order_list")
    public String toOrderUI() {
        return "order/order_list";
    }

    @GetMapping("home")
    public String toHomeUI() {
        return "home";
    }

    @GetMapping("login")
    public String toLoginUI() {
        return "login";
    }

    @GetMapping("unauthorized")
    public String toUnauthorizedUI() {
        return "unauthorized";
    }
}
